import { HouseEntity } from '@/entities/HouseEntity';
import HouseApi from '@/api/HouseApi';

export default class HouseBusiness {
  /**
   * 添加房屋信息
   * @param houseReq 房屋信息
   */
  static addHouse(houseReq: HouseEntity.IAddHouseReq) {
    return HouseApi.addHouse(houseReq);
  }

  /**
   * 更新房屋信息
   * @param houseReq 房屋信息
   */
  static updateHouse(houseReq: HouseEntity.IUpdateHouseReq) {
    return HouseApi.updateHouse(houseReq);
  }

  /**
   * 获取房屋信息
   */
  static getHouse() {
    return HouseApi.getHouse();
  }

  /**
   * 获取房屋通过关键字
   * @param data
   */
  static getHouseByKeyword(data: HouseEntity.IGetHouseByKeyword) {
    return HouseApi.getHouseByKeyword(data);
  }

  /**
   * 删除房屋
   * @param houseId 房屋id
   */
  static delHouse(houseId: number) {
    return HouseApi.delHouse(houseId);
  }

  /**
   * 分页获取房屋
   */
  static getHousesByPage(
    minLat: number,
    maxLat: number,
    minLng: number,
    maxLng: number
  ) {
    return HouseApi.getHousesByPage(
      minLat,
      maxLat,
      minLng,
      maxLng
    );
  }

  /**
   * 通过房屋id获取房屋列表
   */
  static getHouseListByHouseId(houseIdList: string) {
    return HouseApi.getHouseListByHouseId(houseIdList);
  }
}